package com.qf.mapper;

import com.qf.pojo.Account;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Description: 公用常量
 * @Data: 2022/9/1 14:45
 * @Pacakge: com.qf.mapper
 * @ClassName: AccountRowMapper
 * @Author: fan
 */
public class AccountRowMapper implements RowMapper<Account> {
    //mapRow:实体类的属性和数据库字段对应
    @Override
    public Account mapRow(ResultSet resultSet, int i) throws SQLException {
        Account account = new Account();
        account.setId(resultSet.getInt("id"));
        account.setName(resultSet.getString("name"));
        account.setMoney(resultSet.getDouble("money"));
        return account;
    }
}
